


//
//  LoadingAnimation.m
//  界面动画集
//
//  Created by YYY on 2017/7/5.
//  Copyright © 2017年 成品家（北京）网路科技有限公司. All rights reserved.
//

#import "LoadingAnimation.h"

#import "WaveLoadingView.h"


@interface LoadingAnimation ()

@property(nonatomic,strong)WaveLoadingView *waveLoadingView;

@end

@implementation LoadingAnimation

SingletonM;

-(WaveLoadingView *)waveLoadingView
{
    if (!_waveLoadingView)
    {
        _waveLoadingView = [[WaveLoadingView alloc]initWithFrame:CGRectMake(0, 0, 41, 30)];
    }
    return _waveLoadingView;
}
//显示加载动画
-(void)showLoadingAnimation:(UIViewController *)fromViewController
{
    [fromViewController.view addSubview:self.waveLoadingView];
    [fromViewController.view bringSubviewToFront:_waveLoadingView];
    _waveLoadingView.center = fromViewController.view.center;
    
    [_waveLoadingView startAnimation];
    
}
//隐藏加载动画
-(void)hiddenLoadingAnimation
{
    [_waveLoadingView stopAnimation];
}
@end
